home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 15 / develop 15 code / Symmetry & Tiles / Tiler Code / Shell.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-13  |  976 b   |  55 lines  |  [TEXT/KAHL]

  1. #include    "Shell.h"
  2. #include    <graphics libraries.h>
  3. #include    <graphics debugging.h>
  4.  
  5. Boolean            gDoneFlag = false;
  6. Rect            gDeskRect;
  7. MenuHandle        gShellMenuHandles[kNumShellMenus];
  8. long            gClickTime;
  9.  
  10. gxGraphicsClient     gGraphicsClient;
  11.  
  12. main (void)
  13. {
  14.        EventRecord        theEvent;
  15.     CursHandle        Curs;
  16.  
  17.     FlushEvents (everyEvent - diskMask, 0 );
  18.     MaxApplZone();
  19.     InitGraf (&thePort);
  20.     InitFonts ();
  21.     InitWindows ();
  22.     InitMenus ();
  23.     TEInit ();
  24.     InitDialogs (nil);
  25.     InitCursor ();
  26.  
  27.     Curs = GetCursor(watchCursor);
  28.     SetCursor(*Curs);
  29.  
  30.     initshell();
  31.  
  32.     InitCursor();
  33.     
  34.     while(gDoneFlag == false)
  35.     {
  36.         UnloadSeg(initshell);
  37.         WaitNextEvent(everyEvent, &theEvent, 0, nil);
  38.         DoEvent(&theEvent);
  39.     }
  40.     BailOut();
  41. }
  42.  
  43. /*---------------------------------
  44. BailOut()        Clean up and split...
  45. ----------------------------------- */
  46.  
  47. void BailOut(void)
  48. {
  49.     AppCleanUp();
  50.  
  51.     GXExitGraphics();        /** Deallocate all of the default structures **/
  52.     GXDisposeGraphicsClient(gGraphicsClient);
  53.     ExitToShell();
  54. }
  55.